package util;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class GenerarAleatorios {

	public static int generar(int base, int limite) {

		return (int) Math.floor(Math.random() * (base - limite + 1) + limite);

	}

	public static void main(String[] args) {
		System.out.println("Introduce la base:");
		String base = "", limite = "";
		BufferedReader buffer = new BufferedReader(new InputStreamReader(
				System.in));
		try {
			base = buffer.readLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
		System.out.println("Introduce el limite:");
		try {
			limite = buffer.readLine();
		} catch (IOException e) {
			e.printStackTrace();
		}
		int base1 = Integer.parseInt(base);
		int limite1 = Integer.parseInt(limite);
		System.out.println(generar(base1, limite1));

	}
}
